package com.jzo2o.foundations.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 状态枚举
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum FoundationStatusEnum {
    INIT(0,"草稿"),
    ENABLE(2,"启用"),
    DISABLE(1, "禁用");
    private int status;         //状态
    private String description; //描述

    /**
     * 判断是否为有效状态
     */
    public boolean equals(Integer status) {
        return this.status == status;
    }

    /**
     * 枚举值比较
     */
    public boolean equals(FoundationStatusEnum enableStatusEnum) {
        return enableStatusEnum != null && enableStatusEnum.status == this.getStatus();
    }
}
